wolfcrypt polish: init, checks, corrections#6249
Conversation
b5ff2b0 to
0418a74
Compare
|
retest this please |
8ea8e9a to
0210dcd
Compare
|
inadvertently closed; sync with upstream & squashed commits. re-opening for review. |
|
Jenkins retest this please |
wolfcrypt/src/aes.c
Outdated
|
|
||
| #if !defined(WOLFSSL_AES_128) | ||
| if (keylen == 16) { | ||
| return BAD_FUNC_ARG; |
There was a problem hiding this comment.
Indents should be 4 spaces.
There was a problem hiding this comment.
ah yes. I know that well. My bad for letting this one slip by. I've pushed an update to fix
wolfcrypt/src/cmac.c
Outdated
| { | ||
| int ret; | ||
| const byte* subKey; | ||
| word32 remainder = 0; |
There was a problem hiding this comment.
You may get a set but not used with 0 init. Recommend removing the =0. This can also move into the else section. Variable declarations must be at top of function or brace section.
There was a problem hiding this comment.
I've removed the init = 0 and left the declaration at the top of the function.
|
The Jenkins error is: However your code doesn't touch it. Consider a rebase to latest master? |
Good idea. I've refreshed from upstream, but encountered a new error. I suspect trying again might be successful, but perhaps @bandi13 would be interested in reviewing this build timeout error first: |
|
Jenkins retest this please |
|
Hi @dgarske the refresh from upstream worked. Looks like GitHub has been having some recently problems, perhaps this explains prior unexpected and odd Jenkins failures. In any case, please review and let me know if you'd like any other changes. |
* wolfcrypt polish: init, checks, corrections
Description
A variety of minor cleanup and initialization issues to appease compiler complaints, addressed while developing the updates in my ED25519_SHA2_fix branch. Those changes have grown so numerous, I'm breaking down the updates into manageable PR's. 1/n
aes.c- return error if lengths for known-not-definedkeylenvalues encountered.asn.c- return zero (an error when dynamic memory allocation fails) forwc_EncodeSignatureparam lengths less than or equal to zerocmac.c- checkcmac->bufferSz > AES_BLOCK_SIZEinwc_CmacFinaled25519.c- cleanup. variable init.md5.c- check md5 buffer length inwc_Md5Final.random.c- include<esp_random.h>when ESP-IDF v5 detected. Add comments. Correct spelling ofENTROPY_NUM_WORDS_BITSripemd.c- checkripemdbuffLen is not larger thanRIPEMD_BLOCK_SIZEinwc_RipeMdFinal.Fixes zd# n/a
Testing
I've been using these changes in the Espressif development for some time. Here's a script to run the wolfssl
testwolfcryptfrom WSL Ubuntu on Windows:Unit testing
Checklist